<template>
	<view class="top">
		<div class="one">
			<view class="pp">
				<div>
					<text>{{list.name}}</text>
					
					
				</div>
				<div>
					<text>体感温度{{list.temp}}</text>
				</div>
				<div>
					<text>紫外线强度{{list.uvi}}</text>
				</div>
				<div>
					<text>{{list.condition}}</text>
				</div>
			</view>
		</div>
		<div class="xg" @click="gode">
			新冠预约
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				addrDel:'',
				list:[]
			};
		},
		onLoad(){
			wx.getLocation({
				type:'wgs84',
				geocode:true,
				success:(res)=>{
					console.log(res,'121');
					this.addrDel=res
						// longitude=${this.addrDel.longitude}?latitude=${this.addrDel.latitude}
					uni.request({
						url:`https://meituan.thexxdd.cn/api/weather?longitude=${this.addrDel.longitude}&&latitude=${this.addrDel.latitude}`,
						success: (res) => {
							
							this.list=res.data.data[0]
							console.log(this.list,'okok');
						},
					})
				}
			})
			// /weather
		this.getall()
		},
		methods: {
			gode(){
				// console.log('66');
				uni.navigateTo({
					url:'/pages/detil/detil'
				});
			},
			getall(){
				uni.request({
					url:"https://meituan.thexxdd.cn/api/frontpage",
					success: (res) => {
						// console.log(res);
					},
				})
			}
		},
		
	}
</script>

<style lang="scss">
.one{
	height: 350px;
	width: 100vw;
	background:url('https://diancan-1252107261.cos.ap-chengdu.myqcloud.com/tianqi/tianqi-top.png');
	background-size: 100% 100%;
}
.xg{
	width: 100px;
	height: 100px;
	text-align: center;
	line-height: 100px;
	border: 1px solid #000;
	// color:#fff
}
.pp{
	color:#fff
}
</style>
